package com.yh.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yh.bean.t_stu;
import com.yh.service.EmpServiceImpl;

@Controller
@RequestMapping("/stu")
public class StuController {

	@Autowired
	private EmpServiceImpl empServiceImpl;
	@RequestMapping("/retrieval")
	@ResponseBody
	public Map<String, Object> stuRetrieval(t_stu stu,int currentPage){
		
		String phone=stu.getPhone();
		
		Map<String, Object> map=empServiceImpl.retrieval(stu,currentPage);
		
		return map;
	}
	
	@RequestMapping("/deletestu")
	@ResponseBody
	public Map deleteStudent(@RequestParam("arr[]")String[] arr){
		
		for(String a:arr){
			System.out.println("数组是-----"+a+"===");
		}
		int a=empServiceImpl.deleteStu(arr);
		System.out.println("删除了么"+a);
		Map map=new HashMap();
		map.put("message", "删除成功");
		return map;
	}
}
